<?php

require_once 'includes/image_resizer.php'; 
$smsg="";
if($_SESSION['user_id_sess']=="") {
	echo "<script type='text/javascript'> window.location='index.php?signin&url=post'; </script>";
}

if(isset($_REQUEST['keyword']))
{
	$today=date("Y-m-d G:i:s",time());
	$duration=$_REQUEST['post_duration'];
	$bargainDuration = date("Y-m-d G:i:s",time() + ($duration * 24 * 60 * 60));		
	$post_name=$_REQUEST['post_name'];	
	$post_location=$_REQUEST['post_location'];
	$bedroom=$_REQUEST['bedrooms'];
	$bathroom=$_REQUEST['bathrooms'];
	$price=$_REQUEST['price'];
	$service_type=$_REQUEST['service_type'];
	$category="";	
	if($_REQUEST['post_subcategory']!="") {
		$category=$_REQUEST['post_subcategory'];
	}
	else {
		$category=$_REQUEST['post_category'];
	}		
	$post_description=$_REQUEST['post_description'];
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Swapen.com - Buy and Sell</title>
<script src="js/spry/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="js/spry/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<link href="includes/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/functions.js"></script>
</head>
<body>
<table width="950" border="0" align="center" bgcolor="#FFFFFF">
  <tr>

    <td height="119"><table width="100%" border="0"  class="header">
      <tr>
        <td width="3%">&nbsp;</td>
		<td width="33%">
			<span class="boldGrey">
				Welcome! 
Alex2&nbsp; &nbsp;<a href='index.php?signout'>Sign out</a>	
	    </span>		</td>

        <td width="64%" align="right"><span class="boldGrey">
        <a href="index.php">Home</a>&nbsp;|&nbsp;
                 <a href="index.php?products" >Buy</a>&nbsp;|&nbsp; 
                <a href="index.php?sell&by=seller" >Sell</a>&nbsp;|&nbsp;
		 		<a href="index.php?post" style='color:#FF8000'>Post</a>&nbsp;|&nbsp; 
                        
                <a href="index.php?mySwapen" >My Swapen</a>&nbsp;|&nbsp;

                <a href="index.php?profile" >Profile</a>&nbsp;
                </span></td>
  </tr>
      
      <tr>
        <td height="113" colspan="2"><a href='index.php'><img src="images/logo.gif" alt="Swapen" border="0"/></a></td>
        <td align="left"><script type="text/javascript" src="js/tabber.js"></script>
<link rel="stylesheet" href="css/example.css" TYPE="text/css" MEDIA="screen">
<link rel="stylesheet" href="css/example-print.css" TYPE="text/css" MEDIA="print">
<script src="js/spry/SpryTabbedPanels.js" type="text/javascript"></script>

<link href="js/spry/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
function funSearchAll(val) {	
	var frm=document.getElementById(val);
	var spage = frm.spage.value;	
	//check search page
	if(spage=='1') {
		srchPage = "addProduct&";
	} else {
		srchPage = "";
	}
	
	var sg=frm.sg.value; 
	var key=frm.key.value;
	var pf=frm.priceFrom.value; 
	var pt=frm.priceTo.value;
	if(val=='formSearchBuyer'){
	  var st=frm.state.value;  
	  var ct=frm.city.value;
      frm.action="index.php?srchBuyer&sg="+sg+"&key="+key+"&st="+st+"&cty="+ct+"&pf="+pf+"&pt="+pt; 	
	  }
	else if(val!='formSearchOnline')
	{
	  var st=frm.state.value;  
	  var ct=frm.city.value;
	   frm.action="index.php?"+srchPage+"srch&sg="+sg+"&key="+key+"&st="+st+"&cty="+ct+"&pf="+pf+"&pt="+pt;
	}
	else
	   frm.action="index.php?"+srchPage+"srch&sg="+sg+"&key="+key+"&pf="+pf+"&pt="+pt;
	
		
	frm.submit();
}
</script>
<div class="tabber">

     <div class="tabbertab">
	  <h2>JObs</h2>
	  <form name="form1" method="post" action="">
	    <table width="500" border="0">
          <tr>

            <td width="167">Category</td>
            <td width="317">
                        <label>
              <select name="select" id="select">
                            <option value="71">Accounting Jobs</option>
                            <option value="72">Banking Jobs</option>
                            <option value="73">Business Opportunity Jobs</option>

                            <option value="74">Customer Service Jobs</option>
                            <option value="75">Education Jobs</option>
                            <option value="76">Executive Jobs</option>
                            <option value="77">Franchise Jobs</option>
                            <option value="78">Government Jobs</option>
                            <option value="79">Health Care Jobs</option>

                            <option value="80">Information Technology Jobs</option>
                            <option value="81">Inventory Jobs</option>
                            <option value="82">Management Jobs</option>
                            <option value="83">Media - Journalism - Newspaper Jobs</option>
                            <option value="84">Other Jobs</option>
                            <option value="85">Purchasing - Procurement Jobs</option>

                            <option value="86">Research Jobs</option>
                            <option value="87">Sales Jobs</option>
                            <option value="88">Strategy - Planning Jobs</option>
                            <option value="89">Training Jobs</option>
                            <option value="90">Warehouse Jobs</option>
                            <option value="91">Admin - Clerical Jobs</option>

                            <option value="92">Biotech Jobs</option>
                            <option value="93">Construction Jobs</option>
                            <option value="94">Design Jobs</option>
                            <option value="95">Engineering Jobs</option>
                            <option value="96">Facilities Jobs</option>
                            <option value="97">General Business Jobs</option>

                            <option value="98">Government - Federal Jobs</option>
                            <option value="99">Hospitality - Hotel Jobs</option>
                            <option value="100">Installation - Maint - Repair Jobs</option>
                            <option value="101">Legal Jobs</option>
                            <option value="102">Manufacturing Jobs</option>
                            <option value="103">Nonprofit - Social Services Jobs</option>

                            <option value="104">Pharmaceutical Jobs</option>
                            <option value="105">QA - Quality Control Jobs</option>
                            <option value="106">Restaurant - Food Service Jobs</option>
                            <option value="107">Science Jobs</option>
                            <option value="108">Supply Chain Jobs</option>
                            <option value="109">Transportation Jobs</option>

                            <option value="110">Automotive Jobs</option>
                            <option value="111">Business Development Jobs</option>
                            <option value="112">Consultant Jobs</option>
                            <option value="113">Distribution - Shipping Jobs</option>
                            <option value="114">Entry Level Jobs</option>
                            <option value="115">Finance Jobs</option>

                            <option value="116">General Labor Jobs</option>
                            <option value="117">Grocery Jobs</option>
                            <option value="118">Human Resources Jobs</option>
                            <option value="119">Insurance Jobs</option>
                            <option value="120">Legal Admin Jobs</option>
                            <option value="121">Marketing Jobs</option>

                            <option value="122">Nurse Jobs</option>
                            <option value="123">Professional Services Jobs</option>
                            <option value="124">Real Estate Jobs</option>
                            <option value="125">Retail Jobs</option>
                            <option value="126">Skilled Labor - Trades Jobs</option>
                            <option value="127">Telecommunications Jobs</option>

                            <option value="128">Veterinary Services Jobs</option>
                            </select>
            </label></td>
          </tr>
          <tr>
            <td>Location</td>
            <td><label>
              <input type="text" name="textfield" id="textfield">

            </label></td>
          </tr>
          <tr>
            <td>Salary</td>
            <td><label>
              <input type="text" name="textfield2" id="textfield2">
            </label></td>
          </tr>

          <tr>
            <td>Post Date</td>
            <td><label>
              <input type="text" name="textfield3" id="textfield3">
            </label></td>
          </tr>
          <tr>
            <td>Keyword</td>

            <td><label>
              <input type="text" name="textfield4" id="textfield4">
            </label></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><label>
              <input type="submit" name="button" id="button" value="Submit">
            </label></td>

          </tr>
        </table>
       </form>
	  </div>
     <div class="tabbertab">
	  <h2>Rent</h2>
	  <form name="form1" method="post" action="">
	    <table width="100%" border="0">

          <tr>
            <td width="167">Property </td>
            <td width="317"><label>
                          <label>
              <select name="select" id="select">
                            <option value="129">Apartments</option>
                            <option value="130">Houses</option>

                            <option value="131">Townhouses</option>
                            <option value="132">Condos</option>
                            </select>
              </select>
            </label></td>
          </tr>
          <tr>
            <td>Location</td>

            <td><label>
              <input type="text" name="location" id="location">
            </label></td>
          </tr>
          <tr>
            <td>Bedroom</td>
            <td><label>
              <input type="text" name="bedroom" id="bedroom">

            </label></td>
          </tr>
          <tr>
            <td>bathroom</td>
            <td><label>
              <input type="text" name="bathroom" id="bathroom">
            </label></td>
          </tr>

          <tr>
            <td>SQ FT</td>
            <td><label>
              <input type="text" name="sqft" id="sqft">
            </label></td>
          </tr>
          <tr>
            <td>Price</td>

            <td><input type="text" name="price" id="price"></td>
          </tr>
          <tr>
            <td>Post Date</td>
            <td><input type="text" name="postdate" id="postdate"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>

            <td><label>
              <input type="submit" name="button" id="button" value="Submit">
            </label></td>
          </tr>
        </table>
       </form>
     </div>


     <div class="tabbertab">

	  <h2>Real State</h2>
	  <form name="form1" method="post" action="">
	    <table width="100%" border="0">
          <tr>
            <td width="167">Property </td>
            <td width="317"><label>
                          <label>
              <select name="select" id="select">

                            <option value="133">Apartments</option>
                            <option value="134">Townhouses</option>
                            <option value="135">Houses</option>
                            <option value="136">Condos</option>
                            <option value="137">Multi-Family</option>
                            </select>

            </label></td>
          </tr>
          <tr>
            <td>Location</td>
            <td><label>
              <input type="text" name="location" id="location">
            </label></td>
          </tr>

          <tr>
            <td>Bedroom</td>
            <td><label>
              <input type="text" name="bedroom" id="bedroom">
            </label></td>
          </tr>
          <tr>
            <td>bathroom</td>

            <td><label>
              <input type="text" name="bathroom" id="bathroom">
            </label></td>
          </tr>
          <tr>
            <td>SQ FT</td>
            <td><label>
              <input type="text" name="sqft" id="sqft">

            </label></td>
          </tr>
          <tr>
            <td>Price</td>
            <td><input type="text" name="price" id="price"></td>
          </tr>
          <tr>
            <td>Post Date</td>

            <td><input type="text" name="postdate" id="postdate"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><label>
              <input type="submit" name="button" id="button" value="Submit">
            </label></td>
          </tr>
        </table>

       </form>     </div>
	<div class="tabbertab">
	  <h2>Services</h2>
	  <form name="form1" method="post" action="">
	    <table width="100%" border="0">
          <tr>
            <td width="167">Service Type</td>

            <td width="317"><label>
                          <label>
              <select name="select" id="select">
                            <option value="138">Automotive Jobs</option>
                            <option value="139">Beauty</option>
                            <option value="140">Computer</option>
                            <option value="141">Creative</option>

                            <option value="142">Events</option>
                            <option value="143">Farm/Garden</option>
                            <option value="144">Financial</option>
                            <option value="145">Household</option>
                            <option value="146">Labor/move</option>
                            <option value="147">Legal</option>

                            <option value="148">Lessons</option>
                            <option value="149">Pet</option>
                            <option value="150">Skilled trade</option>
                            <option value="151">Therapeutic</option>
                            <option value="152">Travel</option>
                            <option value="153">Write</option>

                            </select>
            </label></td>
          </tr>
          <tr>
            <td>Location</td>
            <td><label>
              <input type="text" name="location" id="location">
            </label></td>

          </tr>
          <tr>
            <td>Price Range</td>
            <td><label>
              To: 
              <input type="text" name="Pricemin" id="textfield2" value="Min">
            From: 
            <input type="text" name="pricemax" id="textfield5" value="Max">
            </label></td>

          </tr>
          
          <tr>
            <td>Keyword</td>
            <td><label>
              <input type="text" name="Keyword" id="Keyword" value="Keyword">
            </label></td>
          </tr>
          <tr>

            <td>&nbsp;</td>
            <td><label>
              <input type="submit" name="button" id="button" value="Submit">
            </label></td>
          </tr>
        </table>
       </form>
     </div>
</div>

<!--<table width="503" style="border-left: solid 1px #CCC;
	border-bottom: solid 1px #CCC;
	border-top: solid 1px #999;
	border-right: solid 1px #999;">
<tr>
<td>
<div id="TabbedPanels1" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" tabindex="0">Search all</li>
    <li class="TabbedPanelsTab" tabindex="0">Online only</li>
    <li class="TabbedPanelsTab" tabindex="0">Buy local</li>
    <li class="TabbedPanelsTab" tabindex="0">Search buyer</li>
  </ul>
  <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent"><form name="formSearchAll" id="formSearchAll" method="post" action="">
	<input type="hidden" name="sg" id="sg" value="all">
	<input type="hidden" name="spage" id="spage" value="0">
<table width="100%" border="0">
  <tr>
    <td width="63%"><input type="text" name="key" id="key" value="" />&nbsp; <input type="submit" value="Search" name="btnSrch" onClick="funSearchAll('formSearchAll');"/> </td>
    <td width="37%"><table width="100%" border="0">
      <tr>
        <td colspan="2" align="center">
			<select name="state" id="state" style="width:145px;" onChange="funSelectCity(this.value,'search-city-all');">
				<option value="">..Select State..</option>
				<option value='1'>Alabama</option><option value='2'>Alaska</option><option value='3'>Arizona</option><option value='4'>Arkansas</option><option value='5'>California</option><option value='6'>Colorado</option><option value='7'>Connecticut</option><option value='8'>Delaware</option><option value='9'>District of Columbia</option><option value='10'>Florida</option><option value='11'>Georgia</option><option value='12'>Hawaii</option><option value='13'>Idaho</option><option value='14'>Illinois</option><option value='15'>Indiana</option><option value='16'>Iowa</option><option value='17'>Kansas</option><option value='18'>Kentucky</option><option value='19'>Louisiana</option><option value='20'>Maine</option><option value='21'>Maryland</option><option value='22'>Massachusetts</option><option value='23'>Michigan</option><option value='24'>Minnesota</option><option value='25'>Mississippi</option><option value='26'>Missouri</option><option value='27'>Montana</option><option value='28'>Nebraska</option><option value='29'>Nevada</option><option value='30'>New Hampshire</option><option value='31'>New Jersey</option><option value='32'>New Mexico</option><option value='33'>New York</option><option value='34'>North Carolina</option><option value='35'>North Dakota</option><option value='36'>Ohio</option><option value='37'>Oklahoma</option><option value='38'>Oregon</option><option value='39'>Pennsylvania</option><option value='40'>Puerto Rico</option><option value='41'>Rhode Island</option><option value='42'>South Carolina</option><option value='43'>South Dakota</option><option value='44'>Tennessee</option><option value='45'>Texas</option><option value='46'>Utah</option><option value='47'>Vermont</option><option value='48'>Virgin Islands</option><option value='49'>Virginia</option><option value='50'>Washington</option><option value='51'>West Virginia</option><option value='52'>Wisconsin</option><option value='53'>Wyoming</option>			</select>		</td>
        </tr>
      <tr>
        <td colspan="2" align="center">
		<div id="search-city-all">
			<select name="city" id="city" style="width:145px;">
				<option value="">..Select City..</option>
			</select>		
		</div></td>
        </tr>
      <tr>
        <td width="50%" align="center">
        <input type="text" name="priceFrom" id="priceFrom" style="width:60px;" value="Min" onBlur="putIndicator(this,'Min')" onFocus="clearIndicator(this,'Min')" onClick="clearIndicator(this,'Min')">		</td>
        <td width="50%" align="center">
         <input type="text" name="priceTo" id="priceTo" style="width:60px;"  value="Max" onBlur="putIndicator(this,'Max')" onFocus="clearIndicator(this,'Max')" onClick="clearIndicator(this,'Max')">		</td>
      </tr>
      <tr>
        <td colspan="2" align="center">Price range</td>
        </tr>
    </table></td>
  </tr>
</table>
</form></div>
    <div class="TabbedPanelsContent"><form name="formSearchOnline" id="formSearchOnline" method="post" action="">
 <input type="hidden" name="sg" id="sg" value="online"> 
 <input type="hidden" name="spage" id="spage" value="0"> 
 <table width="100%" border="0">
  	  <tr>
    	<td width="63%"><input type="text" name="key" id="key" value=""  />&nbsp; <input type="submit" value="Search" name="btnSrch" onClick="funSearchAll('formSearchOnline');"/> </td>
    	<td width="37%"><table width="100%" border="0">
  	  <tr>
      <td height="22">&nbsp;</td>
  	  </tr>
      <tr>
        <td width="50%" align="center">
        <input type="text" name="priceFrom" id="priceFrom" style="width:60px;" value="Min" onBlur="putIndicator(this,'Min')" onFocus="clearIndicator(this,'Min')" onClick="clearIndicator(this,'Min')">
		</td>
        <td width="50%" align="center">
         <input type="text" name="priceTo" id="priceTo" style="width:60px;" value="Max" onBlur="putIndicator(this,'Max')" onFocus="clearIndicator(this,'Max')" onClick="clearIndicator(this,'Max')">
		</td>
      </tr>
      <tr>
        <td colspan="2" align="center">Price range</td>
        </tr>
        <tr>
      <td height="22">&nbsp;</td>
  	  </tr>
    </table></td>
  </tr>
</table>
</form>
</div>
    <div class="TabbedPanelsContent"><form name="formSearchLocal" id="formSearchLocal" method="post" action="">
<input type="hidden" name="sg" id="sg" value="local">
<input type="hidden" name="spage" id="spage" value="0">
<table width="100%" border="0">
  <tr>
    <td width="63%"><input type="text" name="key" id="key"  value="" />&nbsp; <input type="submit" value="Search" name="btnSrch" onClick="funSearchAll('formSearchLocal');"/> </td>
    <td width="37%"><table width="100%" border="0">
      <tr>
        <td colspan="2" align="center">
			<select name="state" id="state" style="width:145px;" onChange="funSelectCity(this.value,'search-city-local');">
				<option value="">..Select State..</option>
				<option value='1'>Alabama</option><option value='2'>Alaska</option><option value='3'>Arizona</option><option value='4'>Arkansas</option><option value='5'>California</option><option value='6'>Colorado</option><option value='7'>Connecticut</option><option value='8'>Delaware</option><option value='9'>District of Columbia</option><option value='10'>Florida</option><option value='11'>Georgia</option><option value='12'>Hawaii</option><option value='13'>Idaho</option><option value='14'>Illinois</option><option value='15'>Indiana</option><option value='16'>Iowa</option><option value='17'>Kansas</option><option value='18'>Kentucky</option><option value='19'>Louisiana</option><option value='20'>Maine</option><option value='21'>Maryland</option><option value='22'>Massachusetts</option><option value='23'>Michigan</option><option value='24'>Minnesota</option><option value='25'>Mississippi</option><option value='26'>Missouri</option><option value='27'>Montana</option><option value='28'>Nebraska</option><option value='29'>Nevada</option><option value='30'>New Hampshire</option><option value='31'>New Jersey</option><option value='32'>New Mexico</option><option value='33'>New York</option><option value='34'>North Carolina</option><option value='35'>North Dakota</option><option value='36'>Ohio</option><option value='37'>Oklahoma</option><option value='38'>Oregon</option><option value='39'>Pennsylvania</option><option value='40'>Puerto Rico</option><option value='41'>Rhode Island</option><option value='42'>South Carolina</option><option value='43'>South Dakota</option><option value='44'>Tennessee</option><option value='45'>Texas</option><option value='46'>Utah</option><option value='47'>Vermont</option><option value='48'>Virgin Islands</option><option value='49'>Virginia</option><option value='50'>Washington</option><option value='51'>West Virginia</option><option value='52'>Wisconsin</option><option value='53'>Wyoming</option>			</select>	
		</td>
        </tr>
      <tr>
        <td colspan="2" align="center">
			<div id="search-city-local">
				<select name="city" id="city" style="width:145px;">
					<option value="">..Select City..</option>
				</select>		
			</div>
		</td>
        </tr>
      <tr>
        <td width="50%" align="center">
        <input type="text" name="priceFrom" id="priceFrom" style="width:60px;" value="Min" onBlur="putIndicator(this,'Min')" onFocus="clearIndicator(this,'Min')" onClick="clearIndicator(this,'Min')">
		</td>
        <td width="50%" align="center">
         <input type="text" name="priceTo" id="priceTo" style="width:60px;" value="Max" onBlur="putIndicator(this,'Max')" onFocus="clearIndicator(this,'Max')" onClick="clearIndicator(this,'Max')">
		</td>
      </tr>
      <tr>
        <td colspan="2" align="center">Price range</td>
        </tr>
    </table></td>
  </tr>
</table>
</form></div>
    <div class="TabbedPanelsContent"><form name="formSearchBuyer" id="formSearchBuyer" method="post" action="">
<input type="hidden" name="sg" id="sg" value="buyer">	
<input type="hidden" name="spage" id="spage" value="0">
<table width="100%" border="0">
  <tr>
    <td width="63%"><input type="text" name="key" id="key"  value="" />&nbsp; <input type="submit" value="Search" name="btnSrch" onClick="funSearchAll('formSearchBuyer');"/> </td>
    <td width="37%"><table width="100%" border="0">
      <tr>
        <td colspan="2" align="center">
			<select name="state" id="state" style="width:145px;" onChange="funSelectCity(this.value,'search-city-buyer');">
				<option value="">..Select State..</option>
				<option value='1'>Alabama</option><option value='2'>Alaska</option><option value='3'>Arizona</option><option value='4'>Arkansas</option><option value='5'>California</option><option value='6'>Colorado</option><option value='7'>Connecticut</option><option value='8'>Delaware</option><option value='9'>District of Columbia</option><option value='10'>Florida</option><option value='11'>Georgia</option><option value='12'>Hawaii</option><option value='13'>Idaho</option><option value='14'>Illinois</option><option value='15'>Indiana</option><option value='16'>Iowa</option><option value='17'>Kansas</option><option value='18'>Kentucky</option><option value='19'>Louisiana</option><option value='20'>Maine</option><option value='21'>Maryland</option><option value='22'>Massachusetts</option><option value='23'>Michigan</option><option value='24'>Minnesota</option><option value='25'>Mississippi</option><option value='26'>Missouri</option><option value='27'>Montana</option><option value='28'>Nebraska</option><option value='29'>Nevada</option><option value='30'>New Hampshire</option><option value='31'>New Jersey</option><option value='32'>New Mexico</option><option value='33'>New York</option><option value='34'>North Carolina</option><option value='35'>North Dakota</option><option value='36'>Ohio</option><option value='37'>Oklahoma</option><option value='38'>Oregon</option><option value='39'>Pennsylvania</option><option value='40'>Puerto Rico</option><option value='41'>Rhode Island</option><option value='42'>South Carolina</option><option value='43'>South Dakota</option><option value='44'>Tennessee</option><option value='45'>Texas</option><option value='46'>Utah</option><option value='47'>Vermont</option><option value='48'>Virgin Islands</option><option value='49'>Virginia</option><option value='50'>Washington</option><option value='51'>West Virginia</option><option value='52'>Wisconsin</option><option value='53'>Wyoming</option>			</select>	
		</td>
        </tr>
      <tr>
        <td colspan="2" align="center">
			<div id="search-city-buyer">
				<select name="city" id="city" style="width:145px;">
					<option value="">..Select City..</option>
				</select>		
			</div>
		</td>
        </tr>
         <tr>
        <td width="50%" align="center">
        <input type="text" name="priceFrom" id="priceFrom" style="width:60px;" value="Min" onBlur="putIndicator(this,'Min')" onFocus="clearIndicator(this,'Min')" onClick="clearIndicator(this,'Min')">
		</td>
        <td width="50%" align="center">
         <input type="text" name="priceTo" id="priceTo" style="width:60px;" value="Max" onBlur="putIndicator(this,'Max')" onFocus="clearIndicator(this,'Max')" onClick="clearIndicator(this,'Max')">
		</td>
      </tr>
      <tr>
        <td colspan="2" align="center">Price range</td>
        </tr>
    </table></td>
  </tr>
</table>
</form></div>
  </div>
</div>
</td>
</tr>
</table>-->
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels(0,1,"TabbedPanels1") 
//-->
</script>
</td>
      </tr>
    </table>
</td>
  </tr>
 <!--  <tr>
    <td>
      <table width="100%"  border="0" align="center">
        <tr>
          <td width="60%">&nbsp;</td>
          <td width="40%" align="right">>><style type="text/css">
	div#search-results { margin:2px; padding:10px; border:1px solid #CCC; }
	
	div#search-panel { margin:0px auto; width:420px; }
	div#search-box div, ul, li { margin:0px; padding:0px; }
	div#search-box { 
		float:left; 
		padding:5px; 		
		width:385px;		
		font-size:13px; font-weight:bold;
	}
	div#search-box ul { 
		float:left; width:100%;  					
	}
	div#search-box ul li {
		float:left; list-style:none; 
		margin-right:2px; 
		display:inline; 
		padding:5px; 
		border:1px solid #CCC;
		background-color:#EAEAEA;	
	}
	div#search-box ul li a {
		float: left; text-decoration:none;
	}
	div#search-box ul li.active {
		border-top:2px #0FB6FA solid;
		background-color:#FFF;	
		border-bottom:none;	
	}
	div#search-box ul li.active a {
		color: #FF8000;
	}

	div#search-box div#search-all, div#search-box div#search-online, 
	div#search-box div#search-buy, div#search-box div#search-buyers
	{  
		float:left; 		 
		border:1px solid #CCC;
		width:381px;		
	}	
	div#search-box { clear:both; }
</style>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$('div#search-box div').hide();
		$('div#search-box div:first').show();
		$('div#search-box ul li:first').addClass('active');
		
		$('div#search-box ul li a').click(function(){ 
			$('div#search-box ul li').removeClass('active');
			$(this).parent().addClass('active'); 
			var currentTab = $(this).attr('href'); 
			$('div#search-box div').hide();
			$(currentTab).show();
			return false;
		});
	});
</script>

			<form name="frmSearchBox" action="index.php?search" method="POST" id="frmSearchBox">
			
				<div id="search-box">
					<ul>
						<li><a href="#search-all">Search All</a></li>
						<li><a href="#search-all">Online Only</a></li>
						<li><a href="#search-all">Buy Local</a></li>
						<li><a href="#search-all">Search buyers</a></li>
					</ul>
					<br>
					<div id="search-all">
						<table width="100%" border="0" align="center">				
							<tr>
							  <td width="64%" height="24">&nbsp;</td>
							  <td align="center"><input type="text" name="textfield3" size="12"></td>
						   </tr>
							<tr>
								<td rowspan="2" align="center">
									<input name="keyword" size="15" type="text" id="keyword"> &nbsp;			  
									<input type="submit" name="Submit" value="Submit">
								</td>
								<td width="36%" height="24" align="center">
									<input type="text" name="textfield4" size="12">							  </td>
							</tr>
							<tr>
							  <td height="22" align="center"><strong>Price Range</strong></td>
						   </tr>
							<tr>
							  <td height="24">&nbsp;</td>
							  <td align="center">
								<input name="textfield" type="text" size="4"> &nbsp; 
								<input name="textfield2" type="text" size="4">
							 </td>
						   </tr>
					  </table> 
					</div>
					<div id="search-online">
						
					</div>
					<div id="search-buy">
						
					</div>
					<div id="search-buyers">
						
					</div>
				</div>			
			<br>			
			</form>							</td>
        </tr>
      </table></td>
  </tr> -->
 
  <tr>
    <td height="193"  class="container"><table width="100%" border="0">

      <tr>
        <td width="214" height="383" valign="top"><table width="212"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td></td>
            </tr>
            <tr>
              <td style="vertical-align:top;">
				
<table width="100%" border="0">
  <tr>

    <td><input type="image" src="images/seller.gif"  onclick="window.location='index.php?registerMember=seller'"/></td>
  </tr>
  
  <tr>
    <td><input type="image" src="images/merchant.gif" onclick="window.location='index.php?registerMerchant'"/></td>
  </tr>
  
  <tr>
    <td ><input type="image" src="images/buyer.gif" onclick="window.location='index.php?registerMember=buyer'"/></td>
  </tr>
  <tr>

    <td><input type="image" src="images/wholeseller.gif" onclick="window.location='index.php?registerWholeseller'"/></td>
  </tr>
</table>
			  </td>
            </tr>
        </table></td>
        <td width="700" height="300" style="vertical-align:top;"> 
              <style type="text/css">
	#sell-form { border:0px solid #CCC; vertical-align:top; padding:10px; float:left; width:93%; margin:2%; }

	#sell-form label{
	float: left;
	width: 130px;
	font-weight: bold;
	}
	
	#sell-form input, select, textarea{	
	width: 280px;
	margin-bottom: 5px;
	font-size:12px;
	}
	
	#sell-form textarea{
	height: 250px;
	width: 450px;
	font-size:12px
	}
	
	#sell-form #submitbutton{
	margin-left: 130px;
	margin-top: 5px;
	width: 90px;
	}
	
	#sell-form br{
	clear: left;
	}

	
</style>
<div id='panel'>
<table width="100%" border="0">

  <tr>
    <td class="contentHeader"><h2>Posts</h2></td>
  </tr>
  <tr>
    <td>
	
	<table width="100%" align="center"  border="0" cellspacing="0">
      <tr>
	  	<td></td>

	  </tr>
      <tr>
        <td height="500">		
		<form name="frmPost" id="frmPost" method="post" action="" enctype="multipart/form-data">    
			  <input type="hidden" name="keyword" id="keyword">
				<div id="sell-form">
									
					<label for="post_category">Category</label>
					<select name="post_category" id="post_category" onChange="javascript:funGetFields(this.value, 'get-fields'); getSubcat(this.value,'sub-category');">
						<option value="">..Select Category..</option>

						<option value='2'>Jobs</option><option value='3'>Rents</option><option value='4'>Real State</option><option value='5'>Services</option>					</select><span id="loader-div"></span><br>					
					<span id="sub-category"> </span>
					
					<label for="post_name">Post Name</label>
					<input type="text" name="post_name" id="post_name" style="width:450px;"><br>
					
					<label for="post_description">Description</label>

					<textarea name="post_description" id="post_description"></textarea><br>					
					
					<label for="post_location">Location</label>
					<input type="text" name="post_location" id="post_location">
					<br>	

					<span id="get-fields"> </span>
					
					<label for="post_image">Post Image</label>
					<input type="file" name="post_image" id="post_image"><br>
					
					<!-- Codex Technology Remove
                    
                    <label for="post_video">Post Video</label>
					<input type="file" name="post_video" id="post_video" disabled><br> 
                    END 
                    -->

															
					<label for="post_duration">Duration</label>
					<select name="post_duration" id="post_duration" style="width:84px;">										
						<option value='3'>3 days</option>
						<option value='5'>5 days</option>
						<option value='7' selected>7 days</option>
						<option value='10'>10 days</option>						
					  </select>					
					<br>					
					
					<label for="post_remarks">Remarks</label>

					<textarea name="post_remarks" id="post_remarks" style="height:40px; font-size:12px;"></textarea><br>
																				
					<input type="button" onClick="funPost();" id="submitbutton" name="submitbutton" value="Submit"><br>
				</div><br>
            
        </form></td>
      </tr>
    </table></td>
  </tr>
</table>
</div>			  <br>           	 
		</td>

      </tr>
    </table></td>
  </tr>
  <tr>
	  	<td></td>
  </tr>
  <tr>
    <td height="80"><table width="100%" cellpadding="0" cellspacing="0">
			<tr>

				<td>
					<div id="footer">
						<ul id="navFooter">
                        <li>
								<a href="index.php">Home</a>
							</li>
							<li>|</li>
                            <li>

								<a href="index.php?about">About</a>
							</li>
							<li>|</li>
                            <li>
								<a href="index.php?terms">Contact Us</a>
							</li>
							<li>|</li>

                            <li>
								<a href="index.php?faq">FAQ</a>
							</li>
							<li>|</li>
                            <li>
								<a href="index.php?agreement">Agreements</a>
							</li>

							<li>|</li>
							<li>
								<a href="index.php?terms">Resolution Center</a>
							</li>
							<li>|</li>
							<li>
								<a href="index.php?policy">Privacy Policy</a>

							</li>							
						</ul>
						<p id="copyright">Copyright 2009 Swapen.com. All rights reserved.</p>
					</div>
				</td>
			</tr>
		</table></td>
  </tr>
</table>

</body>
</html>
	$post_duration=$_REQUEST['post_duration'];	
	$remarks=$_REQUEST['post_remarks'];
	$sqlPost="INSERT INTO tbl_post set post_name='$post_name',
				category_id='$category',				
				post_description='$post_description',
				post_location='$post_location',
				bedroom='$bedroom',
				bathroom='$bathroom',
				price='$price',
				service_type='$service_type',
				post_remarks='$remarks',
				post_duration='$post_duration',			
				posted_by='$userId',
				posted_date='$today'";
	$rstPost=mysql_query($sqlPost) or die(mysql_error());	
	if(mysql_affected_rows()>0) {	
		$smsg="true";
		$postId=mysql_insert_id();	
		$postImage=pathinfo($_FILES["post_image"]["name"]);		
			if(!empty($postImage['extension'])) {			
				if(strtolower($postImage['extension'])=="jpeg" || strtolower($postImage['extension'])=="jpg" || 
					strtolower($postImage['extension'])=="png" || strtolower($postImage['extension'])=="gif") {											
					$orgname=mt_rand();				
					$type=$postImage['extension'];				
					$path="posts/original/".$orgname.$postId.".".$type;					
					$path_thumb="posts/thumb/".$orgname.$postId."_thumb.".$type;					
					$path_medium="posts/medium/".$orgname.$postId."_medium.".$type;									
					move_uploaded_file($_FILES["post_image"]["tmp_name"],$path);				  
					productResize($path, $path_thumb, $path_medium, $type);	
					$imagePath[] = 	$path;	
					$mediumPath[] = $path_medium;	
					$thumbPath[] = 	$path_thumb;	
					$sql_updpro="UPDATE tbl_post set 
								 post_image_thumb='".$path_thumb."',
								 post_image_sample='".$path_medium."',
								 post_image='".$path."'
								 where post_id=$postId";	
					$rst_updpro=mysql_query($sql_updpro) or die(mysql_error());
					if(mysql_affected_rows()==0) { $smsg="false"; }	
				}
			 }		
	}
	else { $smsg="false"; }	
}


?>
<style type="text/css">
	#sell-form { border:0px solid #CCC; vertical-align:top; padding:10px; float:left; width:93%; margin:2%; }

	#sell-form label{
	float: left;
	width: 130px;
	font-weight: bold;
	}
	
	#sell-form input, select, textarea{	
	width: 280px;
	margin-bottom: 5px;
	font-size:12px;
	}
	
	#sell-form textarea{
	height: 250px;
	width: 450px;
	font-size:12px
	}
	
	#sell-form #submitbutton{
	margin-left: 130px;
	margin-top: 5px;
	width: 90px;
	}
	
	#sell-form br{
	clear: left;
	}

	
</style>
<div id='panel'>
<table width="100%" border="0">
  <tr>
    <td class="contentHeader"><h2>Posts</h2></td>
  </tr>
  <tr>
    <td>
	
	<table width="100%" align="center"  border="0" cellspacing="0">
      <tr>
	  	<td><?php if($smsg=="true") { echo "<div id='suc-msg'> Posts inserted successfully. </div>"; } ?></td>
	  </tr>
      <tr>
        <td height="500">		
		<form name="frmPost" id="frmPost" method="post" action="" enctype="multipart/form-data">    
			  <input type="hidden" name="keyword" id="keyword">
				<div id="sell-form">
									
					<label for="post_category">Category</label>
					<select name="post_category" id="post_category" onChange="javascript:funGetFields(this.value, 'get-fields'); getSubcat(this.value,'sub-category');">
						<option value="">..Select Category..</option>
						<?php				
						 $sql_shocat="SELECT * FROM tbl_category where parent_id='0' LIMIT 1,5";
						 $rst_shocat=mysql_query($sql_shocat);
						 while($row_shocat=mysql_fetch_array($rst_shocat)) {
							 $cat_id=$row_shocat['category_id'];
							 $cat_name=$row_shocat['category_name'];							 
							 echo "<option value='$cat_id'>$cat_name</option>";
						 }
						?>
					</select><span id="loader-div"></span><br>					
					<span id="sub-category"> </span>
					
					<label for="post_name">Post Name</label>
					<input type="text" name="post_name" id="post_name" style="width:450px;"><br>
					
					<label for="post_description">Description</label>
					<textarea name="post_description" id="post_description"></textarea><br>					
					
					<label for="post_location">Location</label>
					<input type="text" name="post_location" id="post_location">
					<br>	

					<span id="get-fields"> </span>
					
					<label for="post_image">Post Image</label>
					<input type="file" name="post_image" id="post_image"><br>
					
					<!-- Codex Technology Remove
                    
                    <label for="post_video">Post Video</label>
					<input type="file" name="post_video" id="post_video" disabled><br> 
                    END 
                    -->
															
					<label for="post_duration">Duration</label>
					<select name="post_duration" id="post_duration" style="width:84px;">										
						<option value='3'>3 days</option>
						<option value='5'>5 days</option>
						<option value='7' selected>7 days</option>
						<option value='10'>10 days</option>						
					  </select>					
					<br>					
					
					<label for="post_remarks">Remarks</label>
					<textarea name="post_remarks" id="post_remarks" style="height:40px; font-size:12px;"></textarea><br>
																				
					<input type="button" onClick="funPost();" id="submitbutton" name="submitbutton" value="Submit"><br>
				</div><br>
            
        </form></td>
      </tr>
    </table></td>
  </tr>
</table>
</div>